package com.leapp.sk.viewdelegate.adapter.notify

import android.widget.ImageView
import android.widget.TextView
import com.example.mvp.delegate.BaseAdapterDelegate
import com.leapp.sk.R
import com.leapp.sk.bean.TextImageEntity

/**
 * 常用功能适配器视图托管
 * @author  chaohaipeng  on 2018/8/2.
 */
class CommonFunctionAdapterDelegate : BaseAdapterDelegate(){
    override fun getOptionsMenuId(): Int {
        return 0
    }

    override fun initWidget() {
    }

    override fun onDestroy() {
    }

    override fun initLayoutRes(): Int {
        return R.layout.adapter_common_function
    }

    /**
     * 初始化数据
     */
    fun initData(data: TextImageEntity){
        val iv_acf_image = getView<ImageView>(R.id.iv_acf_image)
        val tv_acf_title = getView<TextView>(R.id.tv_acf_title)
        iv_acf_image.setImageResource(data.icon)
        tv_acf_title.text=data.content
    }

}